#!/usr/bin/env python
import rospy
import time
from std_msgs.msg import Bool

class DummyApplication():
    def __init__(self):
        rospy.init_node('dummy_application', anonymous=True)        
	self.pub = rospy.Publisher('/finish_application', Bool, queue_size=2)
	rospy.Subscriber("/start_application", Bool, self.applicationCallback)
	print "Dummy application is ready"
        
    def applicationCallback(self, data):
	print "Receive application start flag"
	time.sleep(0)
	msg = Bool()
	self.pub.publish(msg)
	print "Application done, publish finishing flag"


if __name__ == '__main__':
    try:
        DummyApplication()
        rospy.spin()
    except rospy.ROSInterruptException:
	rospy.loginfo("Dummy application finished.")
